﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once
#include "OwnerPtr.h"
#include "IJournalData.h"


namespace gcmp
{
    /// \brief 键盘操作类型
    enum class JournalKeyActionType : int32_t
    {
        KeyDown = 0, ///< 键盘按键按下
        KeyUp = 1,   ///< 键盘按键抬起
        Invalid =2,  ///< 无效的按键类型
    };

    /// \brief 日志录制回放数据：键盘操作数据
    class GCMP_JOURNAL_INTERFACE_EXPORT IJournalKeyData : public IJournalData
    {
    public:
        /// \brief 析构函数
        virtual ~IJournalKeyData() {}


        /// \brief 创建一个IJournalKeyData实例
        ///
        /// \return IJournalKeyData实例
        static gcmp::OwnerPtr<IJournalKeyData> Create();

        /// \brief 设置键盘操作的键值
        ///
        /// \param[in] keyCode 键盘操作的键值
        /// \return void
        virtual void SetKeyCode(int keyCode) = 0;

        /// \brief 获取键盘操作的键值
        ///
        /// \return 键盘操作的键值
        virtual int GetKeyCode() const = 0;

        /// \brief 设置键盘操作的操作类型
        ///
        /// \param[in] keyActionType 键盘操作的操作类型
        /// \return void
        virtual void SetKeyActionType(JournalKeyActionType keyActionType) = 0;

        /// \brief 获取键盘操作的操作类型
        ///
        /// \return 键盘操作的操作类型
        virtual JournalKeyActionType GetKeyActionType() = 0;
    };
}

